/*
 * Copyright (C) 2010 Seapeak.Xu
 *
 * fostmq may be copied only under the terms of the GNU General
 * Public License V3, which may be found in the fostmq source kit.
 *
 * Created on: 2010-8-4
 * Author: Seapeak.Xu
 */

#ifndef FOST_THREAD_H_
#define FOST_THREAD_H_
#ifdef __cplusplus
extern "C"
{
#endif

#include <pthread.h>
#include <unistd.h>
#include "fost_typedef.h"

int set_thread_stacksize(pthread_attr_t *attr, const size_t stack_size);

int kill_working_thread(pthread_t tid);

int detach_thread(pthread_attr_t *attr, bool isdetach);

int thread_mutexlocker_init(pthread_mutex_t *locker);

int thread_condlocker_init(pthread_cond_t *locker);

int create_working_thread(void *(*callback)(void *),void *arg);
//why?see course file
#ifdef __cplusplus
}
#endif
#endif /* PTHREADLIB_H_ */
